package com.eheart.demo_jdk21.feature;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.List;
import java.util.stream.Collectors;

public class StringFeature {
    public static void main(String[] args) {
//        var json = StringTemplate.Processor.of((StringTemplate st) -> new JSONObject(st.interpolate()));
        String name = "robin";
        String phone = "13423456789";
        String address = "武汉";
        String doc = """
                {
                "name": "%s",
                "phone": "%s",
                "address": "%s"
                };
                """.formatted(name, phone, address);
        JSONObject json1 = JSONUtil.parseObj(doc);
        List<Object> list = json1.entrySet().stream().map(stringObjectEntry -> stringObjectEntry.getValue()).collect(Collectors.toList());
        System.out.println("list = " + list);


    }
}
